package com.chis.jxc;

import com.alibaba.fastjson.JSON;
import com.chis.jm.bean.qczs.data.TraceErrorData;
import com.chis.jm.pojo.zabbix.TjJxcMntExc;
import com.chis.jmdatatimer.comm.JedisSerializeUtil;
import com.chis.jmdatatimer.comm.TxMgmtModule;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

/**
 * 
 * @Description 查询mysql同步异常表中的数据TJ_JXC_TRACE_EXC
 * @Company zwx
 * @author wlj
 * @version 2019年11月13日
 */
public class JxcTraceExc {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"spring.xml"});
        context.start();
        TxMgmtModule txMgmtModule = (TxMgmtModule) context.getBean("TxMgmtModule");
        try {
            List<TjJxcMntExc> exc = txMgmtModule.findExc();
            for(TjJxcMntExc t : exc){
                TraceErrorData data = (TraceErrorData) JedisSerializeUtil.unserialize(t.getParam());
                String str = JSON.toJSONString(data);
                System.out.println(str);

            }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
